import request from '@/utils/request.js'

// 常量
const api_name = '/product/admin/category'

export default {
    getCategoryList() {
        return request({
            url: `${api_name}/getCategoryList`,
            method: 'get'
        })
    },
    getCategoryPage(params) {
        return request({
            url: `${api_name}/getCategoryPage`,
            method: 'get',
            params: params
        })
    },
    getCategoryDetailsById(id) {
        return request({
            url: `${api_name}/getCategoryDetailsById/${id}`,
            method: 'get'
        })
    },
    saveCategory(data) {
        return request({
            url: `${api_name}/saveCategory`,
            method: 'post',
            data: data
        })
    },
    updateCategory(data) {
        return request({
            url: `${api_name}/updateCategory`,
            method: 'post',
            data: data
        })
    },
    batchDeleteByIds(ids) {
        return request({
            url: `${api_name}/batchDeleteByIds`,
            method: 'post',
            data: ids
        })
    }
}
